-
Notifications
You must be signed in to change notification settings - Fork 55
Edit4 #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Edit4 #12
Conversation
| assert build_url(host_name, relative_url, get_params) == expected_result | ||
|
|
||
|
|
||
| def test__build_url_only_host_name_typeerror(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В этом файле почти везде потерялись вторые подчёркивания
| ("2023,12,15", "19:55", datetime.datetime(datetime.date.today().year, | ||
| datetime.date.today().month, | ||
| datetime.date.today().day, | ||
| 19, 55)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В фикстурах лучше стараться держать данные постатичнее и попроще. Например, ты можешь тут хранить количество дней, которые добавить к тудей, чай и минуту, а сам объект datetime собирать уже в тесте.
| ) | ||
| def test__compose_datetime_from__error(date_str, time_str, expected_error, need_time_str): | ||
| with pytest.raises(expected_error): | ||
| if need_time_str == 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В python для такого используется не 1/0, а True/False
| (0, 0, TypeError, 0, 0), | ||
| ] | ||
| ) | ||
| def test__first__errors(items, default, expected_error, items_need, default_need): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В тесте не дожно быть такой вложенности и такого количества условий. В таком случае лучше разбить на несколько простых тестов
| ] | ||
| ) | ||
| def test__replace_word__errors(text, replace_from, replace_to, expected_error): | ||
| with pytest.raises(expected_error): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лишний отступ
Собрала эрроры в параметрайзы